﻿
template.defaults.imports.to_date = function (thiso, type) {
    if (type === undefined) {
        return moment(thiso).format("YYYY-MM-DD HH:mm:ss");
    }
    return moment(thiso).format(type);
};
template.defaults.imports.to_dateNow = function (thiso, type) {
    if (type === undefined) {
        return moment(thiso, "YYYYMMDD").fromNow();
    }
    return moment(thiso).format(type);
};

template.defaults.imports.to_dateStartOf = function (thiso, type) {
    if (type === undefined) {
        return moment(thiso).startOf("day").fromNow();
    }
    return moment(thiso).format(type);
};

template.defaults.imports.radio_checked = function (thiso, checkvalue) {
    if (thiso == checkvalue) { return 'checked="checked"'; }
    return "";
}